
<h1>Manage Users</h1>

	<p>

	<form id="search_form" method="post" action="">
	<table cellspacing="2" cellpadding="0" border="0">
		<tr>
			<td><input type="text" id="search_query" name="search_query" value="" size="70" /></td>
			<td><input type="submit" id="btSearch" name="btSearch" value="Search" /></td>
			<td>&nbsp;</td>
			<td>Per page:</td>
			<td>
				<select id="ppg" name="ppg">
						<option value="10">10</option>
						<option value="15">20</option>
						<option value="50" selected>50</option>
						<option value="-1">all</option>
				</select>
			</td>
		</tr>
	</table>
	</form>
	
	<div id="search_results-container">
	
	
<table class="greentable">
    <thead>
    <tr>
		<th><a href="javascript:void(0);" onclick="setFilter('id', 'desc');">#</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('type', 'asc');">Type</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('firstname', 'asc');">Name</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('country', 'asc');">Country</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('email', 'asc');">E-mail</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('phone', 'asc');">Phone</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('mt4_uid', 'asc');">MT4 #</a></th>
		<th><a href="javascript:void(0);" onclick="setFilter('added', 'asc');">Registered</a></th>
		<th>&nbsp;</th>
    </tr>
    </thead>
    <tbody>
	<?php 
			foreach($users as $user){ 
	?>
    <tr>
        <td><a name="user-<?php echo $user->id; ?>"></a><?php echo $user->id; ?></td>
        <td><?php echo ucfirst(strtolower($user->type)); ?></td>
        <td><?php echo $user->firstname. ($user->firstname&&$user->lastname?' ':'') . $user->lastname?></td>
        <td><?php echo $user->country; ?></td>
        <td><?php echo $user->email; ?></td>
        <td><?php echo $user->phone; ?></td>
        <td><?php echo $user->mt4_uid; ?></td>
        <td><?php echo $user->u_added ? date("d/m/Y h:i:s A T",$user->u_added) : 'N/A'; ?></td>
		<td class="actions" style="width:25em;">
			<a class="resend" title="Re-send Signup Notification" href="javascript:void(0);" onclick="GolderMarkets.AdminMgt.resendEmailNotif('<?=$user->id?>');">re-send notif</a> 
			<a class="view" title="View" href="javascript:void(0);" onclick="GolderMarkets.AdminMgt.viewUser('<?=$user->id?>');">view</a> 
			<a class="edit" title="Edit" href="javascript:void(0);" onclick="GolderMarkets.AdminMgt.editUser('<?=$user->id?>');">edit</a> 
			<a class="clone" title="Clone this user" href="javascript:void(0);" onclick="GolderMarkets.AdminMgt.cloneUser('<?=$user->id?>');">clone</a>
			<a class="del" title="Delete" href="javascript:void(0);" onclick="GolderMarkets.AdminMgt.deleteUser('<?=$user->id?>');">delete</a>
		</td>
	</tr>
    <?php } ?>
	<?php
			if($users->result_count()==0)
			{
	?>
	<tr><td colspan="9">No users found.</td></tr>
	<?php
			}
			else
			{
	?>
	<tr>
		<td colspan="9"><?=$paging?></td>
	</tr>
	<?php
			}
	?>
    </tbody>
</table>

	</div>